package com.bwie.espojo;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.DateFormat;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

/**
 * @description:
 * @author: ykk
 * @create: 2024-10-08 09:43
 **/
@Data
@AllArgsConstructor
@NoArgsConstructor
@Document(indexName = "esshop",shards = 1,replicas = 1)
public class ESShop {

    @Id
    @Field(type = FieldType.Integer)
    private Integer id;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String name;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String shopNumber;
    @Field(type = FieldType.Date,format = DateFormat.custom,pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    private Date shopTime;
    @Field(type = FieldType.Integer)
    private Integer shopNum;
    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String price;
    @Field(type = FieldType.Integer)
    private Integer status;
}
